// import {http} from "../../common/request";

export default {
	namespaced: true,
	state: {
		cart_info: {}, // 购物车信息
		order_info: {}, // 购物车结算信息
		coupons: [],
		discount: [],
		is_cust_sum: [],
		payment: [],
		table_no: '', // 餐桌号
		branch_uuid: '' // 门店标识,默认一家
	},
	// 同步操作 调用方法 commit
	mutations: {
		// 轮播图
		setCartInfo (state, val) {
			state.cart_info = val
		},
		// 产品分类和产品相关
		setOrderInfo (state, val) {
			state.order_info = val
		},
		// 可用优惠券
		setCoupons (state, val) {
			state.coupons = val
		},
		// 可用折扣
		setDiscount (state, val) {
			state.discount = val
		},
		// 是否选择就餐人数
		setIsCustSum (state, val) {
			state.is_cust_sum = val
		},
		// 支付详情
		setPayment (state, val) {
			state.payment = val
		},
		// 设置整个订单信息
		setOrderData(state, val) {
			state.cart_info = val.cart_info
			state.order_info = val.order_info
			state.coupons = val.coupons
			state.discount = val.discount
			state.is_cust_sum = val.is_cust_sum
			state.payment = val.payment
		},
		// 设置桌号
		setTableNo (state, val) {
			state.table_no = val
		},

		// 设置门店标识
		setBranchUuid(state, val){
			state.branch_uuid = val
		}
	},
	// 异步操作
	actions: {
	},

};
